The Trapezoid Method computes the area under the curve for a second degree polynomial of the form `f(x) = A x^2 + B x + C`. It employs the trapezoid method to approximate the integrated area. The step size (w) is the width of the base of the trapezoids. The smaller the step size, the more accurate the calculation. Compare this with the integrated a third degree polynomial ` f(x) = A/3 x^3 + B/2 x^2 + Cx + D` where, D is 0 and the area is Area = f(a) - f(b).
The area under a continuous curve1 is is given by the definite integral bounded by a and b. If we mathematically describe the curve as some function f(x), then the indefinite integral is defined as:
`int_a^b f(x) dx`
The trapezoidal variation of a Riemann sum, or the trapezoidal rule, calculates the area under the curve (approximating the definite integral) as:
`int_a^b f(x) dx approx (b-a) * (f(a) +f (b))/2`
If we segment the interval a to b into some number of step size segments (w), each of those segments can be defined by its own trapezoid and the sum of them is also an approximation to the area under the curve in the interval a to b.
So, this Area can be further defined as:
`Area = int_a^b f(x) dx approx sum_1^n ((x_(i+1) - x_i) * (f(x_i) +f (x_(i+1)))/2)`, where the step size `w = x_(i+1) - x_i` and `x_n = b`
The curve defined by a second degree polynomial is a smooth curve and thus this equation is estimating the area under the curve. It is estimating the definite integral of the second degree polynomial function defined by the input coefficients. Employing the trapezoid method is a variation on a Riemann Sum2 which slices the area into step size segments. Each constituent piece has an area that is a easily computed as the area of a simple trapezoid. See the slices in the figure.
The Riemann sum method of estimating the area under a curve is based on slicing the area under the curve into many rectangular or trapezoidal pieces and them summing all the pieces as the estimated total area under the curve. Because this equation has an input variable (w) defining the step size of the trapezoid's width, you can compute a more precise area by decreasing the step size variable. In essence, decreasing the step size variable slices the area under the curve into narrower and narrower constituent pieces and more precisely estimates the total area under the curve between start and end boundaries a and b.
In fact, if you could continue to slice the pieces thinner and thinner, by defining the step size variable to be smaller and smaller, your calculation of the area under the curve would approach the actual exact area. This is the basis of the fundamental theory of Calculus. As the step size becomes infinitely small, the calculated area becomes exactly the area under the curve AND is equal to the definite integral of the curve's function..